package io.elegant.sessions.widgets

import android.content.Context
import androidx.appcompat.widget.AppCompatSpinner
import io.elegant.Elegant
import io.elegant.ElegantApiGrpc
import io.elegant.widgets.SpinnerWidget
import io.grpc.stub.StreamObserver
import kotlin.reflect.KClass

class WidgetSpinnerSession(
    stub: ElegantApiGrpc.ElegantApiStub,
    context: Context
): BaseWidgetSession<AppCompatSpinner, SpinnerWidget<AppCompatSpinner>>(stub, context) {
    override val clazz = AppCompatSpinner::class
    @Suppress("UNCHECKED_CAST")
    override val widgetClazz = SpinnerWidget::class as KClass<SpinnerWidget<AppCompatSpinner>>
    override val sendStreamObserver: StreamObserver<Elegant.Interaction> = stub.widgetSpinner(receiveStreamObserver)

}